﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SapB1WebApp.DAL;
using System.Data;
using SapB1WebApp.Utils;

namespace SapB1WebApp.BLL
{
    public class CommonBLL
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        public DataSet GetTax(string companyDB, string category)
        {
            try
            {
                DataSet dt = new DataSet("OVTG");
                CommonDAO bll = new CommonDAO();
                dt = bll.GetOVTG(companyDB, category);
                return dt;
            }
            catch (Exception ex)
            {
                Log.WriteException(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "SystemError", ex);
                return null;
            }
        }
        /// <summary>
        /// Get Wareshouse
        /// </summary>
        /// <returns></returns>
        public DataSet GetWareshouse(string companyDB)
        {
            try
            {
                DataSet dt = new DataSet("OWHS");
                CommonDAO bll = new CommonDAO();
                dt = bll.GetOWHS(companyDB);
                return dt;
            }
            catch (Exception ex)
            {
                Log.WriteException(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "SystemError", ex);
                return null;
            }
        }
        /// <summary>
        /// Get All Company
        /// </summary>
        /// <returns></returns>
        public DataSet GetAllCompany(string companyDB)
        {
            try
            {
                DataSet dt = new DataSet("SRGC");
                CommonDAO bll = new CommonDAO();
                dt = bll.GetAllCompany(companyDB);
                return dt;
            }
            catch (Exception ex)
            {
                Log.WriteException(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "SystemError", ex);
                return null;
            }
        }
    }
}